package com.lin.linchatgpt.utils;

import com.unfbx.chatgpt.entity.chat.ChatCompletion;
import com.unfbx.chatgpt.entity.chat.Message;

import java.util.List;

/**
 * Copyright(C),2022年-2022,霖霖
 *
 * @author 霖霖
 * @version 1.0
 * @date 2023/4/3 22:53
 * @Description
 */
public class ChatCompletionsUtil {
    public static ChatCompletion getChatCompletion(boolean isAsStream, List<Message> message,int token){
        return ChatCompletion
                .builder()
                .model(ChatCompletion.Model.GPT_3_5_TURBO.getName())
                .temperature(0.5)
                .maxTokens(token)
                .messages(message)
                .stream(isAsStream)
                .build();
    }
}
